\(\int \frac {(a+b \log (c x^n))^2}{x^2} \, dx\) [55]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 46 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {2 b^2 n^2}{x}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \]

[Out]

-2*b^2*n^2/x-2*b*n*(a+b*ln(c*x^n))/x-(a+b*ln(c*x^n))^2/x

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {2342, 2341} \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}-\frac {2 b^2 n^2}{x} \]

[In]

Int[(a + b*Log[c*x^n])^2/x^2,x]

[Out]

(-2*b^2*n^2)/x - (2*b*n*(a + b*Log[c*x^n]))/x - (a + b*Log[c*x^n])^2/x

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x}+(2 b n) \int \frac {a+b \log \left (c x^n\right )}{x^2} \, dx \\ & = -\frac {2 b^2 n^2}{x}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right )}{x}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.76 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {\left (a+b \log \left (c x^n\right )\right )^2+2 b n \left (a+b n+b \log \left (c x^n\right )\right )}{x} \]

[In]

Integrate[(a + b*Log[c*x^n])^2/x^2,x]

[Out]

-(((a + b*Log[c*x^n])^2 + 2*b*n*(a + b*n + b*Log[c*x^n]))/x)

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.24

method result size
parallelrisch \(-\frac {b^{2} \ln \left (c \,x^{n}\right )^{2}+2 \ln \left (c \,x^{n}\right ) b^{2} n +2 b^{2} n^{2}+2 a b \ln \left (c \,x^{n}\right )+2 a b n +a^{2}}{x}\) \(57\)
risch \(-\frac {b^{2} \ln \left (x^{n}\right )^{2}}{x}-\frac {\left (-i \pi \,b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )+i \pi \,b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi \,b^{2} \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-i \pi \,b^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+2 b^{2} \ln \left (c \right )+2 b^{2} n +2 a b \right ) \ln \left (x^{n}\right )}{x}-\frac {4 a^{2}-4 i \pi \,b^{2} n \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+2 \pi ^{2} b^{2} \operatorname {csgn}\left (i c \right )^{2} \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-4 i \ln \left (c \right ) \pi \,b^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-4 i \pi a b \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-\pi ^{2} b^{2} \operatorname {csgn}\left (i c \right )^{2} \operatorname {csgn}\left (i x^{n}\right )^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-4 i \pi \,b^{2} n \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )-4 i \ln \left (c \right ) \pi \,b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )-4 i \pi a b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )+2 \pi ^{2} b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right )^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{3}-4 \pi ^{2} b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{5}-\pi ^{2} b^{2} \operatorname {csgn}\left (i x^{n}\right )^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{4}+2 \pi ^{2} b^{2} \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{5}-\pi ^{2} b^{2} \operatorname {csgn}\left (i c \right )^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{4}+8 b^{2} n^{2}+8 \ln \left (c \right ) a b +4 \ln \left (c \right )^{2} b^{2}+8 b^{2} \ln \left (c \right ) n +8 a b n -\pi ^{2} b^{2} \operatorname {csgn}\left (i c \,x^{n}\right )^{6}+4 i \pi a b \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi a b \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi \,b^{2} n \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+4 i \ln \left (c \right ) \pi \,b^{2} \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+4 i \pi \,b^{2} n \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+4 i \ln \left (c \right ) \pi \,b^{2} \operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{4 x}\) \(704\)

[In]

int((a+b*ln(c*x^n))^2/x^2,x,method=_RETURNVERBOSE)

[Out]

-1/x*(b^2*ln(c*x^n)^2+2*ln(c*x^n)*b^2*n+2*b^2*n^2+2*a*b*ln(c*x^n)+2*a*b*n+a^2)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.67 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {b^{2} n^{2} \log \left (x\right )^{2} + 2 \, b^{2} n^{2} + b^{2} \log \left (c\right )^{2} + 2 \, a b n + a^{2} + 2 \, {\left (b^{2} n + a b\right )} \log \left (c\right ) + 2 \, {\left (b^{2} n^{2} + b^{2} n \log \left (c\right ) + a b n\right )} \log \left (x\right )}{x} \]

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="fricas")

[Out]

-(b^2*n^2*log(x)^2 + 2*b^2*n^2 + b^2*log(c)^2 + 2*a*b*n + a^2 + 2*(b^2*n + a*b)*log(c) + 2*(b^2*n^2 + b^2*n*lo
g(c) + a*b*n)*log(x))/x

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.43 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=- \frac {a^{2}}{x} - \frac {2 a b n}{x} - \frac {2 a b \log {\left (c x^{n} \right )}}{x} - \frac {2 b^{2} n^{2}}{x} - \frac {2 b^{2} n \log {\left (c x^{n} \right )}}{x} - \frac {b^{2} \log {\left (c x^{n} \right )}^{2}}{x} \]

[In]

integrate((a+b*ln(c*x**n))**2/x**2,x)

[Out]

-a**2/x - 2*a*b*n/x - 2*a*b*log(c*x**n)/x - 2*b**2*n**2/x - 2*b**2*n*log(c*x**n)/x - b**2*log(c*x**n)**2/x

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.52 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-2 \, b^{2} {\left (\frac {n^{2}}{x} + \frac {n \log \left (c x^{n}\right )}{x}\right )} - \frac {b^{2} \log \left (c x^{n}\right )^{2}}{x} - \frac {2 \, a b n}{x} - \frac {2 \, a b \log \left (c x^{n}\right )}{x} - \frac {a^{2}}{x} \]

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="maxima")

[Out]

-2*b^2*(n^2/x + n*log(c*x^n)/x) - b^2*log(c*x^n)^2/x - 2*a*b*n/x - 2*a*b*log(c*x^n)/x - a^2/x

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.87 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {b^{2} n^{2} \log \left (x\right )^{2}}{x} - \frac {2 \, {\left (b^{2} n^{2} + b^{2} n \log \left (c\right ) + a b n\right )} \log \left (x\right )}{x} - \frac {2 \, b^{2} n^{2} + 2 \, b^{2} n \log \left (c\right ) + b^{2} \log \left (c\right )^{2} + 2 \, a b n + 2 \, a b \log \left (c\right ) + a^{2}}{x} \]

[In]

integrate((a+b*log(c*x^n))^2/x^2,x, algorithm="giac")

[Out]

-b^2*n^2*log(x)^2/x - 2*(b^2*n^2 + b^2*n*log(c) + a*b*n)*log(x)/x - (2*b^2*n^2 + 2*b^2*n*log(c) + b^2*log(c)^2
 + 2*a*b*n + 2*a*b*log(c) + a^2)/x

Mupad [B] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.22 \[ \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^2} \, dx=-\frac {a^2+2\,a\,b\,n+2\,b^2\,n^2}{x}-\frac {b^2\,{\ln \left (c\,x^n\right )}^2}{x}-\frac {2\,b\,\ln \left (c\,x^n\right )\,\left (a+b\,n\right )}{x} \]

[In]

int((a + b*log(c*x^n))^2/x^2,x)

[Out]

- (a^2 + 2*b^2*n^2 + 2*a*b*n)/x - (b^2*log(c*x^n)^2)/x - (2*b*log(c*x^n)*(a + b*n))/x